#include <stdio.h>
#include <string.h>
#include <sys/shm.h>				/* Shared Memory */
#include <sys/types.h>				/* Shared Memory */
#include <sys/ipc.h>				/* Shared Memory */
#include "constantes.h"				/* Constantes propias de estos programas */
#include "sharedmemory.c"

int main()
{
	int shmid;
        key_t clave;
        clave = ftok(DIRECTORIO, SHM_AYUDANTE);
	t_parrilla *shm_ptr;

	shmid = shmget(clave, sizeof(t_parrilla),0666);
	shm_ptr = (t_parrilla *) shmat(shmid, NULL, 0);

	printf("Tengo: %d\n", shm_ptr->cant_chorizos);
	printf("Modifico el valor, le sumo 5\n");

	shm_ptr->cant_chorizos = shm_ptr->cant_chorizos + 5;

	return 0;
}
